var html = document.documentElement
const layout = html.clientWidth || document.body.clientWidth;
html.style.fontSize = layout / 3.75 + 'px'
var gs = location.search
var gid = gs.slice(gs.indexOf('=') + 1)
var details = JSON.parse(sessionStorage.getItem(gid))
if (localStorage.getItem(gid)) {

} else {
  if (gid != 1 && gid != '' && JSON.stringify(details) != null) {
    localStorage.setItem(gid, JSON.stringify(details))
  }
}
$('.goodImg').attr('src', details.url)
$('.goodPrice').text('￥' + details.price + '.00')
$('.goodName').text(details.name)
let n = JSON.parse(localStorage.getItem(gid))
$('.addChart').click(() => {
  n.num++
  localStorage.setItem(gid, JSON.stringify({
    num: n.num,
    url: details.url,
    price: details.price,
    name: details.name
  }))
})